package com.diancan.dc.service.impl;

import java.util.List;
import com.diancan.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.diancan.dc.mapper.DcOrderInfoMapper;
import com.diancan.dc.domain.DcOrderInfo;
import com.diancan.dc.service.IDcOrderInfoService;
import com.diancan.common.core.text.Convert;

/**
 * 订单Service业务层处理
 * 
 * @author dc
 * @date 2021-12-27
 */
@Service
public class DcOrderInfoServiceImpl implements IDcOrderInfoService 
{
    @Autowired
    private DcOrderInfoMapper dcOrderInfoMapper;

    /**
     * 查询订单
     * 
     * @param id 订单主键
     * @return 订单
     */
    @Override
    public DcOrderInfo selectDcOrderInfoById(String id)
    {
        return dcOrderInfoMapper.selectDcOrderInfoById(id);
    }

    /**
     * 查询订单列表
     * 
     * @param dcOrderInfo 订单
     * @return 订单
     */
    @Override
    public List<DcOrderInfo> selectDcOrderInfoList(DcOrderInfo dcOrderInfo)
    {
        return dcOrderInfoMapper.selectDcOrderInfoList(dcOrderInfo);
    }

    /**
     * 新增订单
     * 
     * @param dcOrderInfo 订单
     * @return 结果
     */
    @Override
    public int insertDcOrderInfo(DcOrderInfo dcOrderInfo)
    {
        dcOrderInfo.setCreateTime(DateUtils.getNowDate());
        return dcOrderInfoMapper.insertDcOrderInfo(dcOrderInfo);
    }

    /**
     * 修改订单
     * 
     * @param dcOrderInfo 订单
     * @return 结果
     */
    @Override
    public int updateDcOrderInfo(DcOrderInfo dcOrderInfo)
    {
        return dcOrderInfoMapper.updateDcOrderInfo(dcOrderInfo);
    }

    /**
     * 批量删除订单
     * 
     * @param ids 需要删除的订单主键
     * @return 结果
     */
    @Override
    public int deleteDcOrderInfoByIds(String ids)
    {
        return dcOrderInfoMapper.deleteDcOrderInfoByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除订单信息
     * 
     * @param id 订单主键
     * @return 结果
     */
    @Override
    public int deleteDcOrderInfoById(String id)
    {
        return dcOrderInfoMapper.deleteDcOrderInfoById(id);
    }
}
